<?php

if(isset($_FILES['avatar'])) {
	echo "<pre>";
	print_r($_FILES);

	//$fileName = date('YmdHis').'_'.$_FILES['avatar']['name'];
	$fileName = date('YmdHis').'_'.rand().'_'.$_FILES['avatar']['name'];
	//$fileName = time().'_'.$_FILES['avatar']['name'];
	$src = $_FILES['avatar']['tmp_name'];
	$dest = "uploads/$fileName";
	move_uploaded_file($src,$dest);
}
?>
<form action="" method="post" enctype="multipart/form-data">
	<input type="file" name="avatar">
	<input type="submit" value="Please Upload" />
</form>
